import request from '@/utils/request'

// 分页查询
export const GetClassesListByPage = (pageNum, pageSize, queryDto) => {
    return request({
        url: '/admin/school/classes/findByPage/' + pageNum + '/' + pageSize,
        method: 'get',
        params: queryDto,
    })
}

export const FindAllClass = (collegeId, majorId) => {
    let params = {};
    if (collegeId !== undefined && collegeId !== null) {
        params.collegeId = collegeId;
    }
    if (majorId !== undefined && majorId !== null) {
        params.majorId = majorId;
    }
    return request({
        url: '/admin/school/classes/findAllClasses',
        method: 'get',
        params: params,
    });
};


// 新增班级的方法
export const SaveClasses = data => {
    return request({
        url: '/admin/school/classes/saveClasses',
        method: 'post',
        data: data,
    })
}

// 修改班级数据的方法
export const UpdateClasses = classes => {
    return request({
        url: '/admin/school/classes/updateClasses',
        method: 'put',
        data: classes,
    })
}

// 根据id删除学生
export const DeleteClassesById = userId => {
    return request({
        url: '/admin/school/classes/deleteById/' + userId,
        method: 'delete',
    })
}


